<template>
  <div>
    <el-row :gutter="20">
       <el-col :span="6">
        <div v-loading="treeLoading" element-loading-background="rgba(0, 0, 0, 0)" class="elscrollbar" :style="{'height': tableH + 'px'}">
          <el-scrollbar style="height:100%">
              <projectTree :data="treeData"
                                nodekey="id"
                                show-label-name="name"
                                :expandKeysArr="expandKeysArr"
                                :tree-menus="treeMenus"
                                :expand-all="false"
                                :ifDraggable="true"
                                :has-child-can-add="true"
                                :expand-on-click-node="true"
                                :placeholder="searchHolder"
                                :allowDropType="1"
                                @node-drag-end="getTreeList"
                                @command="handleCommand"
                                @node-click="nodeClick"
                                @handleExpand="handleNodeClick"
                                @handleClose="handleClose"/>
          </el-scrollbar>
      </div>
      </el-col>
      <el-col :span="18"> 
          <el-descriptions title="基本信息" :column="3" size="small" border>
            <el-descriptions-item label="名称" >{{treeInfo.name}}</el-descriptions-item>
            <el-descriptions-item label="编号">{{treeInfo.code}}</el-descriptions-item>
            <el-descriptions-item label="责任部门">{{treeInfo.department}}</el-descriptions-item>
            <el-descriptions-item label="责任人">{{treeInfo.user}}</el-descriptions-item>
            <!-- <el-descriptions-item label="使用状态">{{treeInfo.desc}}</el-descriptions-item>
            <el-descriptions-item label="最近维保日期">{{treeInfo.startTime}}</el-descriptions-item>
            <el-descriptions-item label="下次维保日期">{{treeInfo.endTime}}</el-descriptions-item> -->
            <el-descriptions-item label="状态">{{treeInfo.wbzt}}</el-descriptions-item>
            <el-descriptions-item label="备注">{{treeInfo.remark}}</el-descriptions-item>
          </el-descriptions>
          <div style="margin-block: 10px;
    font-size: 16px;" class="tableToolbarText">资料详情：</div>
        <vxe-grid 
              id="xGrid"
              :loading="tableLoading"
              ref="xGrid"
              border
              resizable
              show-overflow
              keep-source
              highlight-hover-row
              :height="tableH - 190"
              align="center"
              :print-config="{}"
              :import-config="{}"
              :export-config="{}"
              :custom-config="{ storage: true }"
              :toolbar-config="tableToolbar"
              :columns="tableColumn"
              :seq-config="{startIndex: (tablePage.currentPage - 1) * tablePage.pageSize,}"
              :pager-config="tablePage"
              :data="tableData"
              @page-change="handlePageChange"
              @checkbox-change="checkboxChange"
              @checkbox-all="checkboxAll">
              <template #projectName="{ row }">
                <div class="tableTxt tableTxtHoverBlue" @click="show(row)">
                  <!-- <i class="subitem.icon"></i> -->
                  <div class="textHidden">{{ row.name }}</div>
                </div>
              </template>
              <template v-slot:toolbar_buttons>
                <div class="tableToolbar">
                  <div style="min-width:100px" class="tableToolbarText">名称/编号：</div>
                  <el-input v-model="searchName" size="small" style="margin-inline-start:8px;width:50%;" :placeholder="placeholder"
                    clearable @clear="getData(0)" @change="getData(0)" />
                  <vxe-button style="min-width:55px;margin-left:8px" status="primary" size="small" class="tableToolbarTextL"
                    @click="getData(0)">搜索</vxe-button>
                  <vxe-button style="min-width: 55px; margin-left: 8px" status="primary" class="tableToolbarTextL" size="small"
                    @click="createProject">新增</vxe-button>
                    <vxe-button style="min-width: 80px; margin-left: 8px" status="primary" class="tableToolbarTextL" size="small"
                    @click="showSearch">高级搜索</vxe-button>
                </div>
              </template>
              <template #operate="{ row }">
                <el-link type="primary" class="elLinkBTN" @click="edit(row)">下载</el-link>
                <el-link type="danger" class="elLinkBTN" @click="deleteDe(row)">删除</el-link>
              </template>
              <template v-slot:current_pageNum>
                <!-- <span class="vxe-pager--total">当前页 {{ tableData.length }} 条</span> -->
              </template>
              </vxe-grid>
        <!-- <vxe-modal v-model="otherFaultShow"  title="项目详情" width="1500" resize destroy-on-close @close="otherFaultShow = false;activeName = null;">
          <div>
            <el-tabs v-model="activeName" @tab-click="handleClick" v-if="otherFaultShow">
              <el-tab-pane label="试验件" name="1">
                <projectTable1 ref="projectTable1" :treeID="activeName" :numName="numName"></projectTable1>
              </el-tab-pane>
              <el-tab-pane label="人员规划" name="2">
                <projectTable2 ref="projectTable2" :treeID="activeName" :numName="numName"></projectTable2>
              </el-tab-pane>
              <el-tab-pane label="资源规划" name="3">
                <projectTable3 ref="projectTable3" :treeID="activeName" :numName="numName"></projectTable3>
              </el-tab-pane>
              <el-tab-pane label="任务规划" name="4">
                <projectTable4 ref="projectTable4" :treeID="activeName" :numName="numName"></projectTable4>
              </el-tab-pane>
              <el-tab-pane label="测量规划" name="5">
                <projectTable5 ref="projectTable5" :treeID="activeName" :numName="numName"></projectTable5>
              </el-tab-pane>
            </el-tabs>
            <div class="modal_footer">
              <vxe-button status="primary" content="关 闭" size="small" @click="closeVisible" />
          </div>
          </div>
        </vxe-modal> -->
       </el-col>
    </el-row> 
    <div slot="header">
  </div>
  <vxe-modal v-model="showSearchForm" title="高级搜索" width="1500" resize destroy-on-close @close="otherFaultShow = false;activeName = null;">
    <template #default>
      <ProductSearch ref="ProductSearch"></ProductSearch>
  </template>
  </vxe-modal>
  <vxe-modal v-model="otherFaultShow" type="modal " :mask="true" resize :mask-closable="true" :title="formTitle" width="700" :height="tableH - 180" :position="{top: 240, left: 1200}" :show-close="false" destroy-on-close @close="dialogFormClose">
    <template #default>
      <div style="text-align:left">
        <!-- <el-button @click="dialogFormClose">取 消</el-button> -->
        <el-button type="primary" size="mini" @click="save">保  存</el-button>
    </div>
      <vxe-form ref="myform" :data="formInfo" :items="formItems" :rules="formRules">
        <template #planStartTime="{ data }">
          <vxe-input v-model="data.startTime" placeholder="请选择" transfer type="date" labelFormat="yyyy-MM-dd" :disabled-method="disabledPlanStartTime" />
      </template>
      <template #remark222="{ data }">
        <vxe-textarea v-model="data.remark222" ref="zyTextarea"  placeholder="请输入" :autosize="{ minRows: 2, maxRows: 2 }" />
      </template>
      </vxe-form>
  </template>
  </vxe-modal>
  </div>
</template>
<script>
  import projectTree from "../../components/projectTree.vue";
  import ProductSearch from "./components/ProductDataSearch.vue";
  // import projectTable2 from "./components/projectTable2.vue";
  // import projectTable3 from "./components/projectTable3.vue";
  // import projectTable4 from "./components/projectTable4.vue";
  // import projectTable5 from "./components/projectTable5.vue";
  // import projectTable6 from "./components/projectTable6.vue";
  export default {
    components: {
      projectTree,
      ProductSearch
      // projectTable1,
      // projectTable2,
      // projectTable3,
      // projectTable4,
      // projectTable5,
      // projectTable6,
    },
    name: 'TestProject',
    data () {
      return {
        showSearchForm:false,
        treeData:[],
        treeLoading: false,
        tableH: window.innerHeight -100,
        searchHolder: '请输入',
        expandKeysArr: [1,2,3,4,5,6,7],
        treeMenus: [
          { label: '添加', value: 'createAdd', },
          { label: '编辑', value: 'edit', },
          { label: '删除', value: 'delete', },
        ],
        treeInfo:{},
        selectTree:null,
        activeName:null,
        numName:null,
        tableLoading:false,
            searchName:null,
            placeholder:"请输入",
            selectedItems:[],
            tableColumn: [
            { field: 'checkbox', type: 'checkbox', title: '', visible: true, fixed: 'left', width:45 },
            { field: "name", minWidth: 280, title: "名称", fixed: 'left', slots: { default: 'projectName' }},
            { field: "code", minWidth: 100, title: "大小", fixed: 'left', },
            { field: "user", minWidth: 90, title: "状态" },
            { field: "startTime", minWidth: 120, title: "上传日期" },
            { field: "remark", minWidth: 120, title: "备注" },
            { title: "操作",fixed: "right",width: 100,slots: { default: "operate" },},
        ],
            tableToolbar: {
              refresh: {
                query: () => this.getData(0),
              },
              import: false,
              export: false,
              print: false,
              custom: true,
              slots: {
                buttons: "toolbar_buttons",
              },
            },
            tableData: [],
            tablePage: {
              total: 0,
              currentPage: 1,
              pageSize: 50,
              align: "right",
              pageSizes: [50, 80],
              layouts: [
                "Sizes",
                "PrevJump",
                "PrevPage",
                "JumpNumber",
                "NextPage",
                "NextJump",
                "FullJump",
                "Total",
              ],
              perfect: true,
              slots: {
                right: 'current_pageNum'
              }
            },
            otherFaultShow:false,
            showCreate:false,
            formTitle: '',
            formInfo: {},
            formItems: [
                { field: 'name', title: '名称', span: 24, itemRender: { name: '$input', props: { placeholder: '名称' } } },
                { field: 'code', title: '版本', span: 24, itemRender: { name: '$input', props: { placeholder: '编号' } } },
                { field: 'user', title: '创建人', span: 24, itemRender: { name: '$input', props: { placeholder: '负责人' } } },
                { field: 'startTime', title: '创建时间', span: 24, slots: { default: 'planStartTime' } },
                { field: 'remark1', title: '试验描述', span: 24, itemRender: { name: '$input', props: { placeholder: '描述' } } },
                { field: 'remark2', title: '关键字', span: 24, slots: { default: 'remark222' } },
                { field: 'remark3', title: '标签', span: 24, itemRender: { name: '$input', props: { placeholder: '标签' } } },
                { field: 'remark', title: '备注', span: 24, itemRender: { name: '$input', props: { placeholder: '备注' } } },
            ],
            formRules: {
              
            },
            editIndex:0,
      }
    },
    mounted () {
this.inint();
    },
    methods: {
      inint(){
        this.tableLoading = true;
      var that = this;
      setTimeout(function () {
        that.getData(0);
        that.tableLoading = false;
      }, 500);
        this.treeData = [
        {"id":"1","name":"A型巡逻艇","parentID":null,},
        {"id":"2","name":"A型补给船","parentID":null,},
        {"id":"3","name":"船体","parentID":"1",},
        {"id":"4","name":"武器系统","parentID":"1",},
        {"id":"5","name":"上建","parentID":"3",},
        {"id":"6","name":"减摇鳍","parentID":"3",},
        {"id":"7","name":"火控雷达","parentID":"4",},
        {"id":"8","name":"水炮","parentID":"4",},
        {"id":"9","name":"主炮","parentID":"4",},
        {"id":"10","name":"轮机","parentID":"2",},
        ]
      },
      getTreeList (tree) {
        console.log(tree)
      },
      handleCommand (obj) {
        switch (obj.command) {
    case 'create': this.createAdd(obj.data.data);
        break;
    case 'edit': this.editTree(obj.data.data);
        break;
    case 'delete': this.deleteTree(obj.data.data);
        break;
}
      },
      nodeClick (node) {
        this.treeInfo = node;
      },
      handleNodeClick (node, expanded) {
        console.log(node, expanded)
      },
      handleClose (node) {
        console.log(node)
      },
      createAdd(){},
      editTree(){},
      deleteTree(){},
      divideEquipment(){},
      show(row){
         this.otherFaultShow = true;
         this.formTitle = row.name;
         this.formInfo = row;
        // this.activeName = '1';
        // this.$nextTick(function () {
        // this.$refs.projectTable1.show();
        // })
      },
      closeVisible(){
        this.otherFaultShow = false;
        this.activeName = null;
      },
      dialogFormClose(){
        this.showCreate = false;
        this.formInfo = {
          name:'',
          code:'',
          user:'',
          department:'',
          desc:'',
          startTime:null,
          endTime:null,
          remark:'',
        }
      },
      save(){
        var that = this;
        this.showCreate = false;
        that.tableLoading = true;
        if(this.formTitle === '新增'){
            setTimeout(function () {
            that.tableData.push(that.formInfo)
            that.tableLoading = false;
          }, 500);
        }else{
            setTimeout(function () {
            that.tableData.splice(that.editIndex,1,that.formInfo)
            that.tableLoading = false;
          }, 500);
        }
        
      },
      edit(row){
        this.showCreate = true;
        this.formTitle = '编辑';
        this.formInfo = row;
        this.editIndex = this.tableData.findIndex(x=>x.code === row.code);
        console.log(this.editIndex)
      },
      deleteDe (row) {
        this.$confirm(`确定要删除本条记录吗?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var index = this.tableData.findIndex(x => x.code === row.code);
          var that = this;
          that.tableLoading = true;
          setTimeout(function () {
            that.tableData.splice(index, 1)
            that.tableLoading = false;
          }, 500);
        }).catch(() => { });
      },
      getData (type) {
        if (type === 0) {
     this.tablePage.currentPage = 1;
 };
        this.tableData = [
        {"name":"测试数据.doc","code":"1.2M","user":"正式","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"保养技术手册.pdf","code":"566KB","user":"正式","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"维护技术手册.pdf","code":"916KB","user":"临时","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"技术指导手册.doc","code":"866KB","user":"正式","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"测试.doc","code":"26KB","user":"正式","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"测试测试.doc","code":"26KB","user":"正式","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"技术规格参考手册.doc","code":"1566KB","user":"正式","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"测试试验报告.doc","code":"566KB","user":"临时","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"测试试验大纲.doc","code":"0003","user":"正式","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"测试数据.doc","code":"0004","user":"正式","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"测试数据.doc","code":"0005","user":"正式","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"测试数据.doc","code":"0006","user":"正式","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"00001","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"00002","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"00003","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"00004","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"00005","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"00006","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"000001","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"000002","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"000003","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"000004","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"000005","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"000006","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"00111","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"00112","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"00113","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"00114","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"00115","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"00116","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"001111","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"001112","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"001113","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"001114","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"001115","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"001116","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"0021","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"0022","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"0023","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"0024","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"0025","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"0026","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"00221","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"00222","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"00223","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"00224","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"00225","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"00226","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"0031","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"0032","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"0033","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"0034","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"0035","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"0036","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"00331","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"00332","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"00333","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"00334","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"00335","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"00336","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"0051","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"0052","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"0053","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"0054","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        {"name":"tset5","code":"0055","user":"张三","department":"科研五部","desc":"","startTime":"2022-7-14","endTime":"2023-12-21","remark":""},
        {"name":"tset6","code":"0056","user":"李四","department":"科研六部","desc":"","startTime":"2022-8-14","endTime":"2024-2-21","remark":""},
        {"name":"tset1","code":"00551","user":"张三","department":"科研一部","desc":"","startTime":"2022-3-14","endTime":"2023-8-21","remark":""},
        {"name":"tset2","code":"00552","user":"李四","department":"科研二部","desc":"","startTime":"2022-4-14","endTime":"2023-9-21","remark":""},
        {"name":"tset3","code":"00553","user":"王五","department":"科研三部","desc":"","startTime":"2022-5-14","endTime":"2023-10-21","remark":""},
        {"name":"tset4","code":"00554","user":"赵六","department":"科研四部","desc":"","startTime":"2022-6-14","endTime":"2023-11-21","remark":""},
        
        ];
        this.tablePage.total = this.tableData.length;
      },
      createProject(){
        this.showCreate = true;
        this.formTitle = '新增';
        this.formItems[3].itemRender.options = [
          {label:'科研一部',value:'1'},
          {label:'科研二部',value:'2'},
          {label:'科研三部',value:'3'},
          {label:'科研四部',value:'4'},
        ];
        this.formInfo = {
          name:'',
          code:'',
          user:'',
          department:'',
          desc:'',
          startTime:null,
          endTime:null,
          remark:'',
        }
      },
      showSearch(){
        this.showSearchForm = true;
        //this.$refs.ProductSearch.show();
      },
      handleClick(event){
        
      },
      handlePageChange({ currentPage, pageSize }) {
          this.tablePage.currentPage = currentPage;
          this.tablePage.pageSize = pageSize;
          this.getData(0);
      },
      checkboxChange(){
        this.selectedItems = this.$refs.xGrid.getCheckboxRecords();
      },
      checkboxAll(){
        this.selectedItems = this.$refs.xGrid.getCheckboxRecords(true);
      },
      
      disabledPlanStartTime({ date }) {
    if (this.formInfo.endTime === '' || !this.formInfo.endTime) {
        return false;
    } else {
        return date.getTime() >= new Date(this.formInfo.endTime).getTime();
    }
},
disabledPlanEndTime({ date }) {
    if (this.formInfo.startTime === '' || !this.formInfo.startTime) {
        return false;
    } else {
        return date.getTime() <= new Date(this.formInfo.startTime).getTime();
    }
},
        },
        template: "#template"
  }
</script>

<style>
  .tableTxt {
  width: calc(100% + 1px);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.tableTxt div {
  width: 0px;
  flex: 1;
  font-weight: 700;
}
.tableTxt i {
  font-size: 28px;
  margin-right: 8px;
}
.tableTxt svg {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}
  .tableTxtHoverBlue:hover div {
  color: #2c7ef8;
}
  .elscrollbar{
    overflow-x: hidden;

  }
  .tableToolbarText {
    font-weight: 600;
    font-size: 14px;
}
.tableToolbarTextL {
  margin-left: 8px;
}
.elLinkBTN {
  margin: 0 4px;
}
  .tableToolbar {
  display: flex;
  align-items: center;
}
.textHidden {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal_footer {
  width: 100%;
  margin: 10px auto;
  display: flex;
  justify-content: flex-end;
}
.el-descriptions-item__label.is-bordered-label{
background-color: #dcdfe6;
  }
</style>